﻿layui.config({
    base: "/js/"
}).use(['form', 'layer'], function () {

    //获取layer的from对象、父元素的layer对象和jquery对象
    var form = layui.form,
        $ = layui.jquery,
        layer = layui.layer;

    $("#zhuceBtn").click(function () {
        $.post(
            '/Login/Check',
            {
                //获取账号和密码
                usernumber: $('#usernumber').val(),
                password0: $('#password0').val(),
                password1: $('#password1').val(),
            },
            function (result) {
                //在调试版上显示信息
                console.log(result);
                //弹出提示信息
                layer.msg(result);
                if (result == '注册成功，正在跳转登陆页面！') {
                    $.post(
                        '/Login/Add',
                        {
                            //获取账号和密码
                            usernumber: $('#usernumber').val(),
                            password0: $('#password0').val(),
                            password1: $('#password1').val(),
                        })
                    window.location.href = "/Login/Login";
                }
            }
        )

    }
    );
})
function back() {
    window.location.href = "/Login/Login";
}
